Skip to content

chore(repo): Extend linting - #1906

Merged
tmilewski merged 16 commits into
mainfrom
tom/eslint
Oct 31, 2023
Merged

chore(repo): Extend linting#1906
tmilewski merged 16 commits into
mainfrom
tom/eslint

Conversation

@tmilewski

@tmilewski tmilewski commented Oct 17, 2023

Copy link
Copy Markdown
Member

Description

Our current ESLint configuration was global which left a lot to be desired as each of our packages have unique requirements.

This PR extends leans on a generic set of ESLint configurations while also allowing for a lot of customizability at both the ESLint "feature"-level as well as the package-level.

Please focus on this commit as these are the changes: f2c3b64
The other changes are to appease Prettier.

Please Note:

In an effort to keep this PR as minimal as possible, I've disabled a number of rules. The plan is to re-enable them via follow-on PRs.)

Other Notes:

  • The /integration directory has been factored into NPM workspaces and, ultimately, Turborepo. This doesn't have any tangible change other than running linting along with the packages.
  • ESLint (when utilizing Typescript) will target tsconfig.lint.json. If that does not exists, it moves on to tsconfig.json. The lint TSConfig was required in a few cases as the default one wasn't permissive enough with it's includes/excludes.
  • I had to skip the Husky tasks so that it didn't attempt to update and commit all of the "fixable" issues.

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Packages affected

  • @clerk/clerk-js
  • @clerk/clerk-react
  • @clerk/nextjs
  • @clerk/remix
  • @clerk/types
  • @clerk/themes
  • @clerk/localizations
  • @clerk/clerk-expo
  • @clerk/backend
  • @clerk/clerk-sdk-node
  • @clerk/shared
  • @clerk/fastify
  • @clerk/chrome-extension
  • gatsby-plugin-clerk
  • build/tooling/chore

@tmilewski tmilewski self-assigned this Oct 17, 2023
@tmilewski
tmilewski requested a review from a team as a code owner October 17, 2023 18:29
@changeset-bot

changeset-bot Bot commented Oct 17, 2023

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2ae8894

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
eslint-config-custom Minor
@clerk/backend Patch
@clerk/chrome-extension Patch
@clerk/clerk-js Patch
@clerk/clerk-expo Patch
@clerk/fastify Patch
gatsby-plugin-clerk Patch
@clerk/localizations Patch
@clerk/nextjs Patch
@clerk/clerk-react Patch
@clerk/remix Patch
@clerk/clerk-sdk-node Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@LekoArts

LekoArts commented Oct 18, 2023

Copy link
Copy Markdown
Contributor

How much of an effort would it be to to not use tsconfig.lint.json across the board and instead rely on tsconfig.json (and fixing those)? Just as an estimated guess

@tmilewski

Copy link
Copy Markdown
Member Author

How much of an effort would it be to to not use tsconfig.lint.json across the board and instead rely on tsconfig.json (and fixing those)? Just as an estimated guess

@LekoArts Not much of an effort, but it would make the tsconfig.json quite all-encompassing. I just didn't want to cause any unnecessary side-effects.

@tmilewski
tmilewski force-pushed the tom/eslint branch 2 times, most recently from 32cf88c to 3998f07 Compare October 19, 2023 17:01
updated_at: number;
}

export interface OrganizationSuggestionJSON extends ClerkResourceJSON {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This is an exact copy of the interface above it which ESLint didn't catch until now.

Comment thread packages/clerk-js/src/utils/devBrowser.ts Outdated
Comment thread .husky/pre-commit Outdated
@LekoArts

Copy link
Copy Markdown
Contributor

Is the addition of integration into the workspaces necessary? It'll mean that you have to install more dependencies for the monorepo even though you might not be interested in running the tests + you could more easily run into problems of "multiple different versions of packages".

In CI you could still cache the node_modules on an individual level for each test suite.

@tmilewski

tmilewski commented Oct 31, 2023

Copy link
Copy Markdown
Member Author

Is the addition of integration into the workspaces necessary? It'll mean that you have to install more dependencies for the monorepo even though you might not be interested in running the tests + you could more easily run into problems of "multiple different versions of packages".

In CI you could still cache the node_modules on an individual level for each test suite.

@LekoArts There's actually no noticeable difference. I should note that integrations is included, not integations/* so it's not attempting to install each integration test's deps.

@LekoArts

Copy link
Copy Markdown
Contributor

The integration folder doesn't have a package.json file (I see it in another commit but not in the total view of this PR). What you're saying makes sense then, but isn't that package.json then missing?

@tmilewski

Copy link
Copy Markdown
Member Author

The integration folder doesn't have a package.json file (I see it in another commit but not in the total view of this PR). What you're saying makes sense then, but isn't that package.json then missing?

Ah, you are correct, it's a remnant of a past commit. Updated, thanks!

@LekoArts LekoArts left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@tmilewski
tmilewski added this pull request to the merge queue Oct 31, 2023
Merged via the queue into main with commit c895629 Oct 31, 2023
@tmilewski
tmilewski deleted the tom/eslint branch October 31, 2023 16:26
@LekoArts LekoArts mentioned this pull request Nov 3, 2023
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants